import 'package:flutter/material.dart';
import 'package:flutter_business_2003a/bean/category_parent_bean_result.dart';
import 'package:flutter_business_2003a/bean/categoty_goods_list_bean_result.dart';

class ChildCategoryProvider with ChangeNotifier {
  List<CategoryChildtBean> childCategoryList = [];
  List<CategoryGoodsBean> categoryGoodsList = [];
  int size = 10; //为了之后在分类列表中下拉加载而添加的size
  int childId = 14;

  int parentIndex = 0; //左侧导航的下标
  int childIndex = 0; //右侧上方小导航的下标

  changeChildIndex(index) {
    childIndex = index;
    notifyListeners();
  }

  changeParentIndex(index) {
    parentIndex = index;
    notifyListeners();
  }

  setChildCategory(list) {
    childCategoryList = list;
    notifyListeners();
  }

  //为了下拉刷新用的add
  addCategoryGoodsList(list) {
    categoryGoodsList.addAll(list);
    notifyListeners();
  }

  setCategoryGoodsList(list) {
    categoryGoodsList = list;
    notifyListeners();
  }

  addSize() {
    size += 10;
    notifyListeners();
  }

  reSize() {
    size = 10;
    notifyListeners();
  }

  setChildId(childId) {
    this.childId = childId;
    notifyListeners();
  }
}
